
<?php
$id_obat=$_POST['id_obat'];
$nama_obat=$_POST['nama_obat'];
$stok=$_POST['stok'];
$harga_beli=$_POST['harga_beli'];
$id_jenis=$_POST['id_jenis'];
$tanggal=$_POST['tanggal'];
$bulan=$_POST['bulan'];
$tahun=$_POST['tahun'];
$detail=$_POST['detail'];
$date=date("Y-m-d");
$satuan=$_POST['satuan'];
$bentuk=$_POST['bentuk'];
$harga_jual=$_POST['harga_jual'];
$aturan=$_POST['aturan'];
$dosis=$_POST['dosis'];
$array_tanggal=array($tanggal,$bulan,$tahun);
$cetak_tanggal=implode(" ",$array_tanggal);

	$nama_file	=	$_FILES["gambar"]["name"];
		$tipe_file	=	$_FILES["gambar"]["type"];
		$alamat		=	$_FILES["gambar"]["tmp_name"];
		$tujuan		=	"product/$nama_file";
		$gambar		=	move_uploaded_file($alamat, $tujuan);
		if(empty($_FILES["gambar"]["name"])) {
			$gambar_product	=	"substitution_image.jpg";
		} else {
			$gambar_product	=	$_FILES["gambar"]["name"];
		}
	$sql="insert into tbobat(id_obat,nama_obat,stok,tgl_masuk,harga_beli,id_jenis,expaired,detail,gambar,status,satuan,bentuk,harga_jual,aturan,dosis)values('$id_obat','$nama_obat','$stok','$date','$harga_beli','$id_jenis','$tanggal','$detail','$gambar_product','','$satuan','$bentuk','$harga_jual','$aturan','$dosis')";
	$insert=dbQuery($sql)or die(mysql_error());
if($insert){
	?>
	<tr><td colspan="3">&nbsp;</td></tr>
	<tr><td colspan="3" class="judul">&#187 Konfirmasi Input Data Obat</td></tr>
	<tr><td colspan="3" class="jarak_garis"><hr color="#6d6a69"></hr></td></tr>
	<tr><td colspan="3" class="suskes" align="center">Selamat Anda Sukses inputkan data Obat</td></tr>
	
	<tr><td colspan="3">&nbsp;</td></tr>
	<tr><td colspan="3">&nbsp;</td></tr>
<?php }else{
?>
<tr><td colspan="3">&nbsp;</td></tr>
	<tr><td colspan="3" class="judul">&#187 Konfirmasi Input Data Obat</td></tr>
	<tr><td colspan="3" class="jarak_garis"><hr color="#6d6a69"></hr></td></tr>
	<tr><td colspan="3" class="suskes" align="center">Maaf Anda Gagal inputkan Data,coba ulangi verifikasi data yang anda inputkan</td></tr>
	<tr><td colspan="3"><a href="index_admin.php?index=input_obat&cryption=<?php print $random."upn".$santra.$encode; ?>"></td></tr>
	<tr><td colspan="3">&nbsp;</td></tr>
	<tr><td colspan="3">&nbsp;</td></tr>
<?php }


?>